<template>
    <div class="left-nav">
        <Menu :theme="theme2"
              mode="vertical"
              width="150px"
              :active-name="activeName">
            <div class="logo">
                <img src="../assets/logo.png" class="logo-img">
            </div>
            <left-menu :menu-list="menuList"></left-menu>
        </Menu>
    </div>
</template>

<script>
    import LeftMenu from './LeftMenu'

    export default {
        name: "LeftNav",
        data() {
            return {
                activeName: '',
                theme2: 'dark',
                menuList: [
                    {
                        title: '首页',
                        icon: 'md-home',
                        name: 'home',
                        route: '/major/web/home',
                    }, {
                        title: '管理',
                        icon: 'md-apps',
                        name: 'study',
                        sub: [
                            {
                                title: '课程安排',
                                name: 'calendar',
                                route: '/major/web/calendar'
                            },
                            {
                                title: '报名管理',
                                name: '/major/web/curricula',
                                route: '/major/web/curricula'
                            }, {
                                title: '教师管理',
                                name: '/major/web/teacher',
                                route: '/major/web/teacher'
                            }, {
                                title: '考勤管理',
                                name: '/major/web/attendance',
                                route: '/major/web/attendance'
                            }, {
                                title: '记事本管理',
                                name: '/major/web/tickler',
                                route: '/major/web/tickler'
                            }
                        ]
                    }, {
                        title: '设置',
                        icon: 'md-book',
                        name: 'course',
                        sub: [
                            {
                                title: '课程设置',
                                name: 'course-setting',
                                route: '/major/web/course/setting'
                            }
                        ]
                    }, {
                        title: '统计',
                        icon: 'md-stats',
                        name: 'statistics',
                        sub: [
                            {
                                title: '课消统计',
                                name: 'calendar',
                                route: '/major/web/sta/curricula'
                            }
                        ]
                    }
                ]
            }
        },
        components: {
            LeftMenu
        },
        mounted() {
            console.log(this.$route.path)
            this.activeName = this.$route.path;//用name = path;
        },
    }
</script>

<style scoped>
    .ivu-menu-vertical {
        height: 100vh;
    }

    .logo {
        width: 150px;
        height: 100px;
    }

    .logo-img {
        width: 60px;
        margin: 20px 45px;
    }
</style>
